package com.ruoyi.cs.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.cs.domain.vo.TUserSyVo;
import com.ruoyi.common.utils.DateUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cs.mapper.TUserSyMapper;
import com.ruoyi.cs.domain.TUserSy;
import com.ruoyi.cs.service.ITUserSyService;

/**
 * 用户推广收益记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-25
 */
@Service
@SuppressWarnings("all")
public class TUserSyServiceImpl implements ITUserSyService 
{
    @Autowired
    private TUserSyMapper tUserSyMapper;

    /**
     * 查询用户推广收益记录
     * 
     * @param syId 用户推广收益记录ID
     * @return 用户推广收益记录
     */
    @Override
    public TUserSy selectTUserSyById(String syId)
    {
        return tUserSyMapper.selectTUserSyById(syId);
    }

    /**
     * 查询用户推广收益记录列表
     * 
     * @param tUserSy 用户推广收益记录
     * @return 用户推广收益记录
     */
    @Override
    public List<TUserSy> selectTUserSyList(TUserSy tUserSy)
    {
        return tUserSyMapper.selectTUserSyList(tUserSy);
    }

    /**
     * 新增用户推广收益记录
     * 
     * @param tUserSy 用户推广收益记录
     * @return 结果
     */
    @Override
    public int insertTUserSy(TUserSy tUserSy)
    {
        tUserSy.setCreateTime(DateUtils.getNowDate());
        return tUserSyMapper.insertTUserSy(tUserSy);
    }

    /**
     * 修改用户推广收益记录
     * 
     * @param tUserSy 用户推广收益记录
     * @return 结果
     */
    @Override
    public int updateTUserSy(TUserSy tUserSy)
    {
        tUserSy.setUpdateTime(DateUtils.getNowDate());
        return tUserSyMapper.updateTUserSy(tUserSy);
    }

    /**
     * 批量删除用户推广收益记录
     * 
     * @param syIds 需要删除的用户推广收益记录ID
     * @return 结果
     */
    @Override
    public int deleteTUserSyByIds(String[] syIds)
    {
        return tUserSyMapper.deleteTUserSyByIds(syIds);
    }

    /**
     * 删除用户推广收益记录信息
     * 
     * @param syId 用户推广收益记录ID
     * @return 结果
     */
    @Override
    public int deleteTUserSyById(String syId)
    {
        return tUserSyMapper.deleteTUserSyById(syId);
    }

    /**
     * 佣金列表
     * @param tUserSyVo
     * @return
     */
    @Override
    public List<TUserSyVo>  userSyList(TUserSyVo tUserSyVo) {
        List<TUserSyVo> list = tUserSyMapper.userSyList(tUserSyVo);
        return list;
    }

    @Override
    public List<TUserSyVo>  userSyListWeb(String userId, String userName) {
        List<TUserSyVo> list = tUserSyMapper.userSyListWeb(userId, userName);
        return list;
    }

    @Override
    public Map tgSyTotal(String userId) {
        return tUserSyMapper.tgSyTotal(userId);
    }

}
